﻿@using BootstrapBlazor.Shared.Samples
@inject IStringLocalizer<LayoutsApp> Localizer
@inject IStringLocalizer<Menus> LocalizerMenu

<div>@Localizer["LayoutsAppTips1"]</div>
<ul class="mt-2">
    <li>
        <div>@Localizer["LayoutsAppTips2"]</div>
    </li>
    <li>
        <div>@Localizer["LayoutsAppTips3"]</div>
    </li>
</ul>
<div>@Localizer["LayoutsAppTips4"]</div>
<p>
    @((MarkupString)Localizer["LayoutsAppTips5"].Value)
</p>
<p>
    @Localizer["LayoutsAppTips6"]
</p>
<Tips>
    @((MarkupString)Localizer["LayoutsAppTips7"].Value)
</Tips>
<div class="layout-demo layout-demo1">
    <Layout ShowFooter="true" SideWidth="160px">
        <Header>
            <div class="d-flex justify-content-center align-items-center header">Header</div>
        </Header>
        <Side>
            <div style="position: absolute; top: 0; left:0; right: 0; bottom: 0; overflow: auto; border-right: 1px solid rgba(0,0,0,.125); padding: 6px 0;">
                <Menu Items="@IconSideMenuItems" DisableNavigation="true" IsVertical="true"></Menu>
            </div>
        </Side>
        <Main>
            <div style="padding: 1rem;">Main</div>
        </Main>
        <Footer>
            <div class="d-flex justify-content-center align-items-center footer">Footer</div>
        </Footer>
    </Layout>
</div>
<p class="mt-3">
    @Localizer["LayoutsAppTips8"]
</p>
<div class="layout-demo layout-demo2">
    <Layout ShowFooter="true" SideWidth="160px">
        <Header>
            <div class="d-flex justify-content-center align-items-center header">Header</div>
        </Header>
        <Side>
            <div style="border-right: 1px solid rgba(0,0,0,.125); padding: 6px 0;">
                <Menu Items="@IconSideMenuItems" DisableNavigation="true" IsVertical="true"></Menu>
            </div>
        </Side>
        <Main>
            <div style="padding: 1rem;">Main</div>
        </Main>
        <Footer>
            <div class="d-flex justify-content-center align-items-center footer">Footer</div>
        </Footer>
    </Layout>
</div>
<p class="mt-3">
    @((MarkupString)Localizer["LayoutsAppTips9"].Value)
</p>

@code {
    private IEnumerable<MenuItem>? IconSideMenuItems { get; set; }

    /// <summary>
    /// OnInitializedAsync 方法
    /// </summary>
    /// <returns></returns>
    protected override async Task OnInitializedAsync()
    {
        await base.OnInitializedAsync();

        IconSideMenuItems = await MenusDataGerator.GetIconSideMenuItemsAsync(LocalizerMenu);
    }
}
